<!-- 定位主键 -->

<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.6&amp;key=2df5711d4e2fd9ecd1622b5a53fc6b1d"></script>
<script type="text/javascript" src="http://webapi.amap.com/demos/js/liteToolbar.js"></script> 
<script type="text/javascript" src="__STATIC__/js/location.js"></script> 

<div class="controlLocation">
	<div class="city-location">
			<a href="{:__URL('APP_MAIN/Geographical/index')}"><div><i class="fa fa-map-marker icon-location"></i>&nbsp;&nbsp;<span id="citySelect">{$city_session}</span></div></a>
	</div>
</div>

<script type="text/javascript">
//location的height



//获取高度作出padding值
/* var guild = $('.guild').height();
$('.location .mui-indexed-list-inner').css({'padding-top':guild}); */

$(function(){
	getCityLocation();//定位
});
/**
 * 得到定位
 */
function getCityLocation(){
	var citySelect = $("#citySelect").text();
	if(citySelect == ""){
		getLocation(function(data){
			(data != "") ? ($("#citySelect").text(data.addressComponent.city)) (setCityLocation(data.addressComponent.city, false)) : $("#citySelect").text("定位失败");
		});
	}

}
</script>